package com.lnsoft.cac.server.handle.codec;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * 电压监测仪和CAC通信协议 链路解析
 */
@Slf4j
public class CACDecoder extends ByteToMessageDecoder {

    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf byteBuf, List<Object> out) throws Exception {

        try{
            I1FrameDecoder.Decoder(byteBuf, out);
        }catch(Exception e){
            log.error("decoder error!!!",e);
            throw  e;
        }
    }

}
